UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dh3TaUL3pGHi2C+InQOI0CU1VD9KB8u9aQB7ypGlqic=' 
WHERE 
  key_id = '558cdae87665597163092caf649d88b11db7a3fbca5e05b77d90c2a9084d2c3a' 
  AND (
    token = 'dh3TaUL3pGHi2C+InQOI0CU1VD9KB8u9aQB7ypGlqic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025