UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uYQL6neT8GByJdm8UjrrIRyxCORUz59O5J9rvEyvBpw=' 
WHERE 
  key_id = 'c8a2b8d7c66616b7dc0b9a5a66d421c1586340248f55cc02889469e095fc0ae0' 
  AND (
    token = 'uYQL6neT8GByJdm8UjrrIRyxCORUz59O5J9rvEyvBpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044