UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EzYwS5U/UrtJOyoqGkW2Wn2C8jnx99fKOAuJ2aCD6G0=' 
WHERE 
  key_id = '903c0713b85b2d4274483d562c44979e0dcbd108f77e5e050239d29eda74cc4d' 
  AND (
    token = 'EzYwS5U/UrtJOyoqGkW2Wn2C8jnx99fKOAuJ2aCD6G0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047