UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+OploNTHRTlW8o9M23xYae7ZkEwt3yloET7N2CaOpMY=' 
WHERE 
  key_id = '9179dd193be7542a82c385973da4e175490fd2475161b616ea2962f65cf58daf' 
  AND (
    token = '+OploNTHRTlW8o9M23xYae7ZkEwt3yloET7N2CaOpMY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027