UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/QYLm6jxCoSMmd/DXzQ7VPTyVwy0CTe7wIqjAF1efFU=' 
WHERE 
  key_id = '372dbeaed06b3eccdc4c5cfdd14655e47e7ed88d50da236605a7d8ec22ffd8c6' 
  AND (
    token = '/QYLm6jxCoSMmd/DXzQ7VPTyVwy0CTe7wIqjAF1efFU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024