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

Query time 0.00046