UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oB0hAsaVmuz/Wrdu0j/F8YNRJFbb+v26OtIlfXXH2kc=' 
WHERE 
  key_id = 'cfb3a7609d2e10e93d1290e565eeee6a0e1130b7e3d3ccef3caa460f53954ce5' 
  AND (
    token = 'oB0hAsaVmuz/Wrdu0j/F8YNRJFbb+v26OtIlfXXH2kc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033