UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KumpVBHAWn0Hx81+xeSc8f5kxat2Zt3ki6eConIIGuo=' 
WHERE 
  key_id = '20548783ae1fbe9bd932d835383efa82000455fd6e8408954bbed645c52a47a7' 
  AND (
    token = 'KumpVBHAWn0Hx81+xeSc8f5kxat2Zt3ki6eConIIGuo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021