UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2fNmRKmzH1SIMYlv3waYJnXO3HpsrBc82Hy0Q81lSFE=' 
WHERE 
  key_id = '1066fe8b67940bd74e5fe4360c69a8c4488b21c7a63b6e2b8f41c5267590e3db' 
  AND (
    token = '2fNmRKmzH1SIMYlv3waYJnXO3HpsrBc82Hy0Q81lSFE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033