UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6ilXI01aYRP7GrErgBcPI2dR3RCUDAzeksTSL7Att1M=' 
WHERE 
  key_id = '35293314ff145991c22db88fc6f2fae435906f02cba167ee46709cb6d52b34df' 
  AND (
    token = '6ilXI01aYRP7GrErgBcPI2dR3RCUDAzeksTSL7Att1M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044