UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BcvF09yAgKB4gqSiDoU4hTi9zOK1WAHV5A5rvKPtZAw=' 
WHERE 
  key_id = '0ddbc911d5c9d11d8edb07a7e85bf87084668d98a94ace5694c2150bb7303922' 
  AND (
    token = 'BcvF09yAgKB4gqSiDoU4hTi9zOK1WAHV5A5rvKPtZAw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034