UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tt7LHRcmjgZZB52TPD4sl7ZHDwvgbLOtzANzCSnSXOw=' 
WHERE 
  key_id = '82ad031f64346103f3b33da9459b64aa93a40d9f6b9e6322b1c9492090ce0ba6' 
  AND (
    token = 'tt7LHRcmjgZZB52TPD4sl7ZHDwvgbLOtzANzCSnSXOw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021