UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tOL0YepqTw/IdoxSGwozvapL5sGpPhVVdnmCFbQ6hPQ=' 
WHERE 
  key_id = '961946e52c1e72c65b6abe59174babbfbfa7369c1b9f44fc88f2c947f46d9c4b' 
  AND (
    token = 'tOL0YepqTw/IdoxSGwozvapL5sGpPhVVdnmCFbQ6hPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027