UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Zv/FtIprerODSQ1Qiu9hChz3Cg8/LOj+/sRg1Bl4Yk=' 
WHERE 
  key_id = 'e809dc9f465a754bc646b9c36653300bc191c08294f5ae97cf278e4866285f35' 
  AND (
    token = '5Zv/FtIprerODSQ1Qiu9hChz3Cg8/LOj+/sRg1Bl4Yk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032