UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1yBMWdi3v0tqnsZ2urd0b4QS+Rhn71UYYu9mc8UJCLk=' 
WHERE 
  key_id = '7ba53077f890bafbf5eadddaf4158f8dea500aa760443fcb47c4f5b82613bb56' 
  AND (
    token = '1yBMWdi3v0tqnsZ2urd0b4QS+Rhn71UYYu9mc8UJCLk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027