UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fDbQgfEgilPn2wSdmrW8wT+Bj2KCMScqrITrGg2jFCI=' 
WHERE 
  key_id = '2a213a374de8bb6fb6afeba950ec17776c8f5d0666da2927450ccc4be16d9d17' 
  AND (
    token = 'fDbQgfEgilPn2wSdmrW8wT+Bj2KCMScqrITrGg2jFCI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021