UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/rYTwD+Ai6KHCBbQBd6qiIXer+Y++Ja+ROArx6uhcd0=' 
WHERE 
  key_id = 'a12d8c3fabf89ccdd997fdc9862ab52fa96c2f21f8b0a44957b81ee4bcaff47e' 
  AND (
    token = '/rYTwD+Ai6KHCBbQBd6qiIXer+Y++Ja+ROArx6uhcd0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038