UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JEj5P3X7ZOnJqTWM/14/sGYNS5aIb80RXLQ8r4pVKaU=' 
WHERE 
  key_id = 'a0f928872bacdb7047b21beb657d9597b05936df65176c2f4f9e8089b7e45c23' 
  AND (
    token = 'JEj5P3X7ZOnJqTWM/14/sGYNS5aIb80RXLQ8r4pVKaU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033