UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D2ApIC686HQSyliZesrsS2uN4ccVN89QKtF7qJOItA4=' 
WHERE 
  key_id = '87af3e9fea5452d4849871e54425f26a98ff523f32d209d57953474e082b0586' 
  AND (
    token = 'D2ApIC686HQSyliZesrsS2uN4ccVN89QKtF7qJOItA4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020