UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+caXIwS1Xf+voKcq7WLdQkjxPn4WyL/n5poI7309Bc0=' 
WHERE 
  key_id = 'd8bb2c2709d52af405f6ec3dc7333098d2a006d2e4a7f29a1d2ea1d6c574b428' 
  AND (
    token = '+caXIwS1Xf+voKcq7WLdQkjxPn4WyL/n5poI7309Bc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034