UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hx9voWRXRNzTAeCGJ3BkVn0pPOmwPMTUmHu4TkDhGv8=' 
WHERE 
  key_id = '738854f64b41a7de2439c1343269c34c8529d5bfd6bfeaec759ef15a7d72af57' 
  AND (
    token = 'hx9voWRXRNzTAeCGJ3BkVn0pPOmwPMTUmHu4TkDhGv8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031