UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iWcc544oOlTUxbLQE/5FiOzBScglFzDIYDwaLLiQBco=' 
WHERE 
  key_id = 'fbcfba5deb1c465468151fa943fbf5e9cfea5876e3c02051d45c911542828a1b' 
  AND (
    token = 'iWcc544oOlTUxbLQE/5FiOzBScglFzDIYDwaLLiQBco=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040