UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fxjqDrM9mxkCjV2ejxW3Yzrm2CxCFuIuaVFox/gfi8I=' 
WHERE 
  key_id = 'e0cbcb26788cd09c8aa954f356c17871989dc9d3a0b470911467dd10cebf15a9' 
  AND (
    token = 'fxjqDrM9mxkCjV2ejxW3Yzrm2CxCFuIuaVFox/gfi8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040