UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RTBKmwRC0RLWNEzzFIIvDe6/MGtvSnDdo4mDkU4rzX0=' 
WHERE 
  key_id = 'fecfefc0b5660b013fff7327fdece72f2f28fef11709b553704032b4fb8896d1' 
  AND (
    token = 'RTBKmwRC0RLWNEzzFIIvDe6/MGtvSnDdo4mDkU4rzX0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00065