UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dc5KvL0bB5wKoU53Nvt7hDM+jOhdrBbHW8fFyzxU/28=' 
WHERE 
  key_id = 'd9d3610bb5f4a257d67bd6bae668e2b8fc4e52d282574a0b5197ffda65ba22ca' 
  AND (
    token = 'Dc5KvL0bB5wKoU53Nvt7hDM+jOhdrBbHW8fFyzxU/28=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029