UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S7X/XdIH48+8gbcqCKz3RRJfDM/NXh+dx1yVzMDLplI=' 
WHERE 
  key_id = '98bcdc94962bd5a402cb01cd78c097dac9d3d03417806de7f903ab1c3332299d' 
  AND (
    token = 'S7X/XdIH48+8gbcqCKz3RRJfDM/NXh+dx1yVzMDLplI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032