UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Bk5dfxHzQsrXWQMH7s9AFhNjyXJzmd0nkjoSy2X/50=' 
WHERE 
  key_id = 'f66e0fbb77f1309935a54ccda2ca345200df2dd8f8fb6364492a1b5cf92e7d40' 
  AND (
    token = '5Bk5dfxHzQsrXWQMH7s9AFhNjyXJzmd0nkjoSy2X/50=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034