UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EQm72ihG9G91wrrjAUmp2zni+xOo9MCXAK5dAG5biXE=' 
WHERE 
  key_id = '8d58cc3e125635011cf0b03cc3a8366e937fec8a8a9293ba4b9bb4681b7f1abc' 
  AND (
    token = 'EQm72ihG9G91wrrjAUmp2zni+xOo9MCXAK5dAG5biXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036