UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cNdc/awubkJP7M7ZlKY49E7o5JIouWg0coWGdTeMECw=' 
WHERE 
  key_id = '2da1daa38625c8a3cb1c19e316c095f61b09877b07e0f452a3895f545ac3d7a9' 
  AND (
    token = 'cNdc/awubkJP7M7ZlKY49E7o5JIouWg0coWGdTeMECw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018