UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Boz1o80eDa2lvBup6dOZT+vPQDNGqLbR6m2cgE3ZG74=' 
WHERE 
  key_id = '55697692eb571b9779f8d322552e5bda9413ddc3d360c9e5418d025f2959aef8' 
  AND (
    token = 'Boz1o80eDa2lvBup6dOZT+vPQDNGqLbR6m2cgE3ZG74=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064