UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pb3WynPM23FREg32uetn+VDWkFcraqV6hL++/UNrb3M=' 
WHERE 
  key_id = '1cb94f33213c8a8f38292f96a5e6f34acf3cf030bf09cecadbe9182cacbeed0c' 
  AND (
    token = 'pb3WynPM23FREg32uetn+VDWkFcraqV6hL++/UNrb3M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042